package cfi.jdo;

import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

@PersistenceCapable(detachable = "true")
public class Purchase {
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key key;

	// 購入日
	@Persistent
	private Date purchaseDate;

	// 購入者
	@Persistent
	private CoffeeCustomer coffeeCustomer;

	public Purchase(Date purchaseDate, CoffeeCustomer customer) {
		super();
		this.purchaseDate = purchaseDate;
		this.coffeeCustomer = customer;
	}

	public Date getPurchaseDate() {
		return purchaseDate;
	}

	public void setPurchaseDate(Date purchaseDate) {
		this.purchaseDate = purchaseDate;
	}

	public CoffeeCustomer getCustomer() {
		return coffeeCustomer;
	}

	public void setCustomer(CoffeeCustomer customer) {
		this.coffeeCustomer = customer;
	}

	public Key getKey() {
		return key;
	}

	public void setKey(Key key) {
		this.key = key;
	}
}
